home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_03_shs_cinematic_2.cog < prev    next >
Text File  |  1999-11-15  |  45KB  |  1,651 lines

  1. # Jones 3D Cog Script
  2. #
  3. # 03_SHS_Cinematic_2.cog
  4. #
  5. # Indy encounters the Holy Woman
  6. #
  7. # [HB]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ===================================================================
  12.  
  13. symbols
  14.  
  15. # **************************** MESSAGES *****************************
  16.  
  17.     message        startup
  18.     message        activated
  19.     message        callback
  20.     message        user0
  21.     message        user1
  22.     message        user2
  23.     message     entered
  24.     message        pulse
  25.  
  26. # **************************** KEYFRAMES ****************************
  27.  
  28.     keyframe    in_pushHat=0in_figithat_4_4.key            local
  29.     keyframe    in_rtarmup=0in_armsout_1_1.key            local
  30.     keyframe    in_botharmsup=0in_armsup_1_1.key        local
  31.     keyframe    in_ltarmup=0in_leftarm_1_1.key            local
  32.  
  33.     keyframe    in_armsCrossed=0in_stand2.key            local
  34.     keyframe    in_handsOnHips=0in_stand4.key            local
  35.     keyframe    in_crossArms=0in_stand1_bd_2.key        local
  36.     keyframe    in_handsToHips=0in_stand1_bd_4.key        local
  37.     keyframe    in_lift=0in_bar_attempt_1_1.key            local
  38.  
  39.     keyframe    in_plantready=0in_pull_bulb_1_14.key    local
  40.     keyframe    in_giveplant=0in_giveobj_14_1.key        local
  41.     keyframe    in_wow=0in_reaction.key                    local
  42.     keyframe    in_takekey=0in_takeobj_1_1.key            local
  43.  
  44.     keyframe    in_pull=in_pull_lever_down.key            local
  45.     keyframe    lever_down=gen_lever.key                local
  46.  
  47.     keyframe    br_fwd=0ri_roll_fwd.key                    local
  48.     keyframe    br_back=0ri_roll_back.key                local
  49.  
  50.     keyframe    ol_confused=0ol_lookaround_5_1.key        local
  51.     keyframe    ol_basicstand=ol_stand.key                local
  52.     keyframe    ol_stand2honcane=0ol_stand2_nohead.key    local
  53.     keyframe    ol_standwkey=0ol_stand3_nohead.key        local
  54.     keyframe    ol_ltwave=0ol_lefthnd_2_2.key            local
  55.     keyframe    ol_takeplantA=0ol_getobj_2_parta.key    local
  56.     keyframe    ol_takeplantB=0ol_getobj_partb_4.key    local
  57.     keyframe    ol_showkey=0ol_holdupkey_1_3.key        local
  58.     keyframe    ol_givekey=0ol_handkey_3_2.key            local
  59.     keyframe    ol_pointcane=0ol_pointcane_1_2.key        local
  60.     keyframe    ol_wavecane2=0ol_righthnd_2_1.key        local
  61.     keyframe    ol_lookatbud=0ol_stand4.key                local
  62.     
  63.     keyframe    yl_bentover=0yl_stand4.key                local
  64.     keyframe    yl_transform=0yl_transform_4_2.key        local
  65.     keyframe    yl_upright=0yl_stand2.key                local
  66.     keyframe    yl_losecane=0yl_throwcane_2_3.key        local
  67.     keyframe    yl_standwf=0yl_stand3.key                local
  68.     keyframe    yl_putflower=0yl_placepot_3_1.key        local
  69.     keyframe    yl_throwbar=0yl_pushbar_1_1.key            local
  70.     keyframe    yl_opendoors=0yl_opendoors_1_1.key        local
  71.     keyframe    yl_lthandup=0yl_left_1_1.key            local # currently rthand (!)
  72.     keyframe    yl_armspointway=0yl_armsout_1_1.key        local
  73.     keyframe    yl_armsup=0yl_armsup_1_1.key            local
  74.  
  75.     keyframe    plant_wait=shs_flower_stand.key            local
  76.     keyframe    plant_bloom=shs_flower_bloom.key        local
  77.     keyframe    cane_fly=0yl_cane_throwcane.key            local
  78.  
  79.     keyframe    bar_flip=shs_bar_lock.key                local
  80.     keyframe    ldr_open=shs_door_barl.key                local
  81.     keyframe    rdr_open=shs_door_barr.key                local
  82.  
  83. # ***************************** MODELS ******************************
  84.  
  85.     model        mod_in_hand_key=hand_in_olkey.3do        local
  86.     model        mod_in_hand_bud=hand_in_bud.3do            local
  87.  
  88.     model        mod_ol_hand_key=hand_ol_key.3do            local
  89.     model        mod_ol_hand_bud=hand_ol_bud.3do            local
  90.  
  91.     model        mod_yl_hand_cane=hand_yl_cane.3do        local
  92.     model        mod_yl_hand_bloom=hand_yl_bloom.3do        local
  93.  
  94. # ***************************** SOUNDS ******************************
  95.  
  96.     sound        ol_rang=Ss05w01.wav                        local
  97.     sound        in_thatsright=Ss05j02.wav                local
  98.     sound        ol_wanthelp=Ss05w03.wav                    local
  99.     sound        in_lost=Ss05j04.wav                        local
  100.     sound        ol_youhelpme=Ss05w05a.wav                local
  101.     sound        ol_evillegacy=Ss05w05b.wav                local
  102.     sound        in_showmeway=Ss05j06.wav                local
  103.     sound        ol_goldtreasure=Ss05w07.wav                local
  104.     sound        in_whereisit=Ss05j08.wav                local
  105.     sound        ol_treasury=Ss05w09a.wav                local
  106.     sound        ol_takekey=Ss05w09b.wav                    local
  107.     sound        ol_hello2=Ss05w10.wav                    local
  108.     sound        in_notfoundyet=Ss05j11.wav                local
  109.     sound        ol_looktreasury=Ss05w12.wav                local
  110.     sound        ol_followwater=Ss05w16.wav                local
  111.     sound        ol_livingloving=Ss05w17.wav                local
  112.     sound        ol_hello3=Ss05w13.wav                    local
  113.     sound        in_foundbulbA=Ss05j14a.wav                local
  114.     sound        in_foundbulbB=Ss05j14b.wav                local
  115.     sound        ol_mustbecome=Ss05w15.wav                local
  116.     #sound        ol_snort=Ss05w07a.wav                    local
  117.  
  118.     sound        ol_gottreasure=Ss09w01.wav                local
  119.     sound        in_bestdo=Ss09j02.wav                    local
  120.     sound        ol_notyet=Ss09w03.wav                    local
  121.  
  122.     sound        yl_greatgift=Ss09y04.wav                local
  123.     sound        yl_waytocurse=Ss09y05.wav                local
  124.     sound        yl_bewareice=Ss09y06.wav                local
  125.  
  126.     sound        in_nowork=Inxj092.wav                    local
  127.     sound        in_notgoodenough=Inxj093.wav            local
  128.     sound        in_hmm=inxj269.wav                        local
  129.     sound        in_somethingwrong=Inxj090.wav            local # ...something wrong.
  130.     
  131.     sound        leverpull=nub_lever_pull_c.wav            local
  132.     sound        leverback=nub_lever_reset_c.wav            local
  133.  
  134.     sound        in_doorlocked=Inxj101.wav                local
  135.     sound        in_notopen=Inxj096.wav                    local
  136.     sound        in_groan=Inxj018.wav                     local
  137.  
  138.     sound        sndDoorOpen=shs_doorlady_c.wav            local
  139.     sound        sndBarThrow=shs_barthrow_c.wav            local
  140.     sound        sndCaneThrow=shs_cane_throw.wav            local
  141.     sound        sndBRrolling=shs_bringer_move.wav        local    #temp
  142.     sound        sndBRspin=shs_bringer_spin.wav            local
  143.  
  144.     # music 
  145.     sound        musBRringing=mus_shs_ringbell.wav        local 
  146.     sound        musYL=mus_shs_womanappears.wav            local 
  147.     sound         musEerie=mus_gen_eerie2.wav                 local    
  148.     sound         musStrange=mus_gen_strange1.wav            local
  149.  
  150. # ***************************** THINGS ******************************
  151.  
  152.     thing        player                                    local
  153.  
  154.     thing        indy                                    linkid=0
  155.     thing        CTbellringer
  156.     thing        bellringer
  157.     thing        oldlady
  158.     thing        younglady
  159.     thing        lever
  160.     thing        barlock
  161.  
  162.     thing        plant                                    nolink
  163.     thing        static_flower                            nolink
  164.     thing        flyingcane                                nolink
  165.  
  166.     thing        leftdoor                                nolink
  167.     thing        rightdoor                                nolink
  168.     thing        barup                                    nolink
  169.     thing        ldooropen                                nolink
  170.     thing        rdooropen                                nolink
  171.     thing        ldoorclose                                nolink
  172.     thing        rdoorclose                              nolink
  173.  
  174.     thing        cam_1                                    nolink
  175.     thing        cam_2                                    nolink
  176.     thing        cam_3                                    nolink
  177.     thing        cam_4                                    nolink
  178.     thing        cam_5                                    nolink
  179.     thing        cam_6                                    nolink
  180.     thing        cam_7                                    nolink
  181.     thing        cam_8                                    nolink
  182.     thing        cam_9                                    nolink
  183.     thing        cam_10                                    nolink
  184.     thing        cam_11                                    nolink
  185.     thing        cam_12                                    nolink
  186.     thing        cam_13                                    nolink
  187.  
  188.     thing        c_t1                                    nolink
  189.     thing        c_t2                                    nolink
  190.     thing        c_t3                                     nolink
  191.     thing        c_t4                                    nolink
  192.     thing        c_t5                                    nolink
  193.     thing        c_t6                                    nolink
  194.     thing        c_t7                                    nolink
  195.     thing        c_t8                                    nolink
  196.     thing        c_t9                                    nolink
  197.     thing        c_t10                                    nolink
  198.     thing        c_t11                                    nolink
  199.     thing        c_t12                                    nolink
  200.     thing        c_t13                                    nolink
  201.     thing        c_t14                                    nolink
  202.     thing        c_t15                                    nolink
  203.  
  204.     thing        c_t2_br                                    local # created in cog
  205.  
  206.     thing        ol_mk1                                    nolink
  207.     thing        ol_plantspot                            nolink
  208.  
  209.     thing        yl_mk1                                    nolink
  210.     thing        yl_mk2                                    nolink
  211.     thing        yl_mk3                                    nolink
  212.     thing        yl_mk4                                    nolink
  213.     thing        yl_mk5                                    nolink
  214.  
  215.     thing        in_mk2                                  nolink
  216.     thing        in_mk3                                    nolink
  217.     thing        in_mk4                                    nolink
  218.     thing        in_mk5                                    nolink
  219.     thing        in_mk6                                    nolink
  220.     thing        in_mk7                                    nolink
  221.  
  222.     thing        br_mk1                                    nolink
  223.     thing        br_mk2                                    nolink
  224.  
  225.     thing        headLookThing                            local # var
  226.     thing        camPosThing                                local # var
  227.  
  228.     thing        sunburst                                local
  229.     thing        norollcam                                local # created at cam_1
  230.  
  231. # ************************ ENGINE WEIRDNESS *************************
  232.  
  233.     cog            ringercog                                 # shs_clock.cog
  234.     cog            bellcog                                    # shs_bellmove.cog
  235.  
  236.     sector        trigger
  237.  
  238.     template    ghost_tpl=ghost                            local
  239.     template    sunburst_tpl=shs_sunburst                local
  240.     template    fairyDust_tpl=shs_flowerdust            local
  241.     
  242. # **************************** VARIABLES ****************************
  243.     
  244.     vector        camPos                                    local
  245.     vector        debugVector                                local
  246.  
  247.     vector        ladyPosVec                                local
  248.     vector        indyPosVec                                local
  249.     vector        indyAimVec                                local
  250.     vector        indyNormVec                                local
  251.  
  252.     vector        posOffset                                local
  253.     vector        angOffset                                local
  254.     
  255.     flex        oldladyCollSize                            local
  256.     flex        ol_rotRate                                local
  257.     flex        in_rotRate                                local
  258.     flex        movespeed=1.0                            local
  259.     flex        indyTrackRate=0.05                        local
  260.  
  261.     flex        tempVX                                    local
  262.     flex        tempVY                                    local
  263.     flex        tempflex                                local
  264.  
  265.     int            cutSceneState=0                            local
  266.     int            leverState=0                            local
  267.     int            ringerState=0                            local
  268.     int            ringerready=0                            local
  269.     int            bellready=0                                local
  270.     int            bellRangAlready=0                        local
  271.     int            belltop=0                                local
  272.     int            plantState=0                            local
  273.     int            doorchat=0                                local
  274.     int            olNowAtSpot=0                            local
  275.  
  276.     int            in_keyTrack1                            local
  277.     int            in_keyTrack2                            local
  278.     int            br_keyTrack1                            local
  279.     int            ol_keyTrack1                            local
  280.     int            yl_keyTrack1                            local
  281.     int            plt_keyTrack1                            local
  282.     int            can_keyTrack1                            local
  283.     int            bar_keyTrack1                            local
  284.     int            ldr_keytrack1                            local
  285.     int            rdr_keyTrack1                            local
  286.  
  287.     int            sender                                    local
  288.     int            curSound                                local
  289.     int            curCam                                    local
  290.     int            callNum                                    local
  291.     
  292.     int            in_swapCase=0                            local
  293.     int            ol_swapCase=0                            local
  294.     int            yl_swapCase=0                            local
  295.  
  296.     int            in_swapRef                                local
  297.     int            ol_swapRef                                local
  298.     int            yl_swapRefCane                            local
  299.     int            yl_swapRefPlant                            local
  300.  
  301.     int            oldladyCollType                            local
  302.     
  303.     int            oldladykey=115                            local # inventory bin
  304.     int            plantbulb=104                            local # inventory bin
  305.     int            plantleaf=105                            local # inventory bin
  306.     int            plantbud=106                            local # inventory bin
  307.     
  308.     int            noRollComment                            local
  309.     int            noRingComment                            local
  310.  
  311.     int            BRrollingloop                            local
  312.     int            BRspinloop                                local
  313.     int            activateFilter=0                        local
  314.  
  315.     int            index                                    local
  316.     int            camexists=0                                local
  317.     int            vibe=0                                      local
  318.     
  319. # **************************** SUBROUTINES ****************************
  320.  
  321.     flex        rollringer                                local
  322.     flex         ringbell                                local
  323.     flex         backtoplay                                local
  324.     flex         noring                                    local
  325.     flex        noroll                                    local    
  326.     flex        morechat                                local    
  327.     flex        doorbarred                                local
  328.     flex        iceprompt                                local
  329.     flex        givetreasure                            local
  330.     flex        gotbulb                                    local
  331.     flex        noprogress                                local
  332.  
  333. end
  334.  
  335. # ===================================================================
  336.  
  337. code
  338.  
  339. # ...................................................................
  340.  
  341. startup:
  342.  
  343.     # Pointer to Player...
  344.     player = GetLocalPlayerThing();
  345.  
  346.     # Prep Old Holy Woman...
  347.     SetThingFlags(oldlady, 0x80000);
  348.     oldladyCollSize = GetThingCollideSize(oldlady);
  349.     oldladyCollType = GetCollideType(oldlady);
  350.     ol_rotRate = GetThingMaxRotVel(oldlady);
  351.     AISetCutSceneMode(oldlady);
  352.  
  353.     # Prep actors...
  354.     SetThingFlags(younglady, 0x80000);
  355.     AISetCutSceneMode(younglady);
  356.     AISetCutSceneMode(indy);
  357.  
  358.     # Hide the many objects...
  359.     SetThingFlags(plant, 0x80000);
  360.     SetThingFlags(static_flower, 0x80000);
  361.     SetThingFlags(flyingcane, 0x80000);
  362.     SetThingFlags(barup, 0x80000);
  363.     SetThingFlags(leftdoor, 0x80000);
  364.     SetThingFlags(rightdoor, 0x80000);
  365.     SetThingFlags(ldooropen, 0x80000);
  366.     SetThingFlags(rdooropen, 0x80000);
  367.     return;
  368.  
  369. # ...................................................................
  370.  
  371. user0:
  372.  
  373.     # NOTE: Sent by whatever attached cogs know the overall readiness 
  374.     # states of the bellringer and the bell to signify NOT READY...
  375.     
  376.     sender = GetSenderRef();
  377.  
  378.     if (sender == ringercog)
  379.     {
  380.         ringerready = 0; # bellringer cannot perform its duties
  381.     }
  382.  
  383.     if (sender == bellcog)
  384.     {
  385.         bellready = 0; # bell is not in position
  386.     }
  387.  
  388.     return;
  389.  
  390. # ...................................................................
  391.  
  392. user1:
  393.  
  394.     # NOTE: Sent by whatever attached cogs know the overall readiness 
  395.     # states of the bellringer and the bell to signify READY FOR ACTION...
  396.  
  397.     sender = GetSenderRef();
  398.  
  399.     if (sender == ringercog)
  400.     {
  401.         ringerready = 1; # bellringer can ring
  402.     }
  403.  
  404.     if (sender == bellcog)
  405.     {
  406.         bellready = 1; # bell is in position
  407.     }
  408.  
  409.     return;
  410.  
  411. # ...................................................................
  412.  
  413. user2:
  414.  
  415.     # NOTE: Sent by attached bellcog when bell reaches top of tower...
  416.     # (currently, this cog pays no attention)
  417.  
  418.     sender = GetSenderRef();
  419.  
  420.     if (sender == bellcog)
  421.     {
  422.         belltop = 1; # bell is all the way up
  423.     }
  424.  
  425.     return;
  426.  
  427. # -------------------------------------------------------------------
  428.  
  429. entered:
  430.  
  431.     # NOTE:  use this with a trigger to pop the old lady to a nice convenient spot
  432.     # near the flower stand when Indy returns...
  433.  
  434.     if (GetSenderRef() != trigger) return;
  435.     if (bellRangAlready == 1 && olNowAtSpot == 0)
  436.     {
  437.         olNowAtSpot = 1;
  438.         TeleportThing(oldlady, ol_plantspot);
  439.     }
  440.     return;
  441. # ...................................................................
  442.  
  443. activated:
  444.  
  445.     sender = GetSenderRef();
  446.     if(activateFilter != 0) return;
  447.     activateFilter = 1;
  448.     if (sender == lever && leverState == 0)
  449.     {
  450.         # Indy must ring the bell to meet the old lady...
  451.  
  452.         # Prep for cutscene...
  453.         StartCutscene(1);
  454.         curCam = GetCurrentCamera();
  455.  
  456.         leverState = 1;
  457.  
  458.         ### temp develop stuff...
  459.         #ringerready = 1;
  460.         #ChangeInv(player, 106, 1);
  461.         #SetInvAvailable(player, 106, 1);
  462.         #bellready = 1;
  463.         ###
  464.  
  465.         # Prep indy...
  466.         in_rotRate = GetThingMaxRotVel(indy);
  467.         SetThingMaxRotVel(indy, 375.0);
  468.         TeleportThing(indy, in_mk2);
  469.  
  470.         # Disable player...
  471.         StopThing(player); # right now
  472.         PlayMode(player, 1, 0); # get him into a nice stand
  473.         DeselectWeaponWait(player); # stow any weapon or lighter
  474.         CopyPlayerHolsters(player, indy); # make sure our actor has matching props
  475.         Sleep(0.5); # give him some time to do his stuff
  476.  
  477.         # Switch actor indy for player...
  478.         SetThingFlags(player, 0x80000); # hide him
  479.         SetActorFlags(player, 0x200000); # paralyze him
  480.         ClearThingFlags(indy, 0x80000); # reveal our actor
  481.  
  482.         # Prep camera & cut...
  483.         SetCameraLookInterp(2, 0); # no pan & tilt
  484.         SetCameraPosInterp(2, 0); # no dolly
  485.         SetCameraFocus(2, cam_1);
  486.         SetCameraSecondaryFocus(2, c_t1);
  487.         SetCurrentCamera(2);
  488.         SetCameraFOV(55, 0, 0.0);
  489.         Sleep(0.01);
  490.  
  491.         PlayKey(lever, lever_down, 4, 0x12, 0);
  492.         PlayKey(indy, in_pull, 4, 0x12, 0);
  493.         Sleep(1.2);
  494.         PlaySoundLocal(leverpull, 1.0, 0, 0x0000, 0);
  495.         Sleep(1.4);
  496.         PlaySoundLocal(leverback, 1.0, 0, 0x0000, 0);
  497.         Sleep(0.3);
  498.  
  499.         if (ringerready == 1)
  500.         {
  501.             call rollringer; 
  502.  
  503.             if (bellready == 1 && bellRangAlready == 0)
  504.             {
  505.                 call ringbell;
  506.                 camPosThing = cam_8; # pos for interp back to follow cam
  507.                 call backtoplay;
  508.             }
  509.             else 
  510.             {
  511.                 call noring;
  512.                 camPosThing = c_t5;
  513.                 call backtoplay;
  514.             }
  515.         }
  516.         else
  517.         {
  518.             call noroll;
  519.             camPosThing = c_t5;
  520.             call backtoplay;
  521.         }    
  522.     }
  523.     else
  524.     {
  525.         if (sender == oldlady || sender == younglady)
  526.         {
  527.             # Talk to her...
  528.             call morechat;
  529.         }
  530.         else 
  531.         {
  532.             if (sender == barlock)
  533.             {
  534.                 # Notice the barred door...
  535.                 call doorbarred;
  536.             }
  537.         }
  538.     }
  539.     activateFilter = 0;
  540.     return;
  541.  
  542. # ========================================================================================
  543.             
  544. pulse:
  545.         
  546.         vibe = RandBetween(1, 4);
  547.         if (vibe == 1)
  548.         {
  549.             posOffset = '-0.008 0.00 -0.002'; #1 was .005x
  550.             angOffset = '0.00 -0.002 0.002';
  551.         }
  552.     
  553.         if (vibe == 2)
  554.         {
  555.             posOffset = '0.008 -0.005 0.002'; #2 was .005x
  556.             angOffset = '0.002 0.00 -0.002';
  557.         }
  558.     
  559.         if (vibe == 3)
  560.         {
  561.             posOffset = '0.005 0.005 -0.005'; #3 was .002x
  562.             angOffset = '-0.002 0.005 -0.005';
  563.         }
  564.     
  565.         if (vibe == 4)
  566.         {
  567.             posOffset = '-0.002 0.00 0.005'; #4
  568.             angOffset = '0.00 0.00 0.002';
  569.         }
  570.         
  571.         vibe = RandBetween(1, 3);
  572.         if (vibe == 1)
  573.         {
  574.             SetPulse(0.05);
  575.         }
  576.         if (vibe == 2)
  577.         {
  578.             SetPulse(0.1);
  579.         }
  580.         if (vibe == 3)
  581.         {
  582.             SetPulse(0.15);
  583.         }
  584.  
  585.         SetPOVShake(posOffSet, angOffSet, 200.0, 200.0);
  586.  
  587.         
  588.     return;
  589.             
  590.  
  591. # ...................................................................
  592.  
  593. rollringer:
  594.  
  595.     # Prep bellringer shot...
  596.     SetThingFlags(CTbellringer, 0x80000); # hide other bellringer
  597.     ClearThingFlags(bellringer, 0x80000); # reveal bellringer
  598.     c_t2_br = CreateThing(ghost_tpl, c_t2); # dupe target & frame (see Marcus)
  599.     CaptureThing(c_t2_br);
  600.     AttachThingToThing(c_t2_br, bellringer); # glue it to bellringer
  601.  
  602.     # Start him twirling...
  603.     br_keyTrack1 = PlayKey(bellringer, br_fwd, 4, 0x10, 0);
  604.         
  605.     # Cut to bellringer...
  606.     SetCameraFocus(2, cam_2);
  607.     SetCameraSecondaryFocus(2, c_t2_br); # aim at new target near ringer
  608.     SetCameraFOV(60, 0, 0.0); # was 70
  609.     Sleep(0.01);
  610.  
  611.     BRrollingloop = PlaySoundLocal(sndBRrolling, 1.0, 0, 0x0001, 0);
  612.     BRspinloop = PlaySoundLocal(sndBRspin, 1.0, 0, 0x0001, 0);
  613.     
  614.     # Move ringer...
  615.     AISetMoveSpeed(bellringer, 1.2);
  616.     AISetLookThing(bellringer, br_mk2);
  617.     AISetMoveThing(bellringer, br_mk2, 0);
  618.  
  619.     # Indy watches...
  620.     AISetLookThing(indy, cam_2);
  621.     headLookThing = bellringer;
  622.     AIEnableHeadTracking(indy, headLookThing);
  623.  
  624.     # Boom & Zoom to tightly frame ringer...
  625.     MoveToFrame(c_t2_br, 1, 0.25);
  626.     Sleep(0.01);
  627.     SetCameraFOV(38, 1, 4.0);
  628.     Sleep(4.5);
  629.  
  630.     # Boom & Zoom back...
  631.     # TO DO:  find out why next MoveToFrame() screws up target attachment!
  632.     # MoveToFrame(c_t2_br, 0, 0.35);
  633.     SetCameraFOV(60, 1, 3.0);
  634.  
  635.     # Indy watches...
  636.     Sleep(3.5);
  637.     AISetLookThing(indy, in_mk7);
  638.  
  639.     # Bellringer continues to move into ring/noring code...
  640.     ringerState = 1;
  641.  
  642.     return;
  643.  
  644. # ...................................................................
  645.  
  646. ringbell:
  647.  
  648.     # This should happen just once...
  649.     bellRangAlready = 1;
  650.  
  651.     # Reposition Indy...
  652.     TeleportThing(indy, in_mk6);
  653.     Sleep(0.01);
  654.     AISetLookThing(indy, in_mk7);
  655.  
  656.     # Prep holy woman under the bell...
  657.     ClearThingFlags(oldlady, 0x80000);
  658.     SetThingMaxRotVel(oldlady, 40.0);
  659.  
  660.     # Cut inside tower...
  661.     SetCameraLookInterp(2, 0); # no pan & tilt
  662.     SetCameraFocus(2, cam_3);
  663.     SetCameraSecondaryFocus(2, bellringer);
  664.     SetCameraFOV(80, 0, 0.0);
  665.     Sleep(0.01);
  666.  
  667.     SetCameraLookInterp(2, 1); # allow pan & tilt
  668.     SetCameraInterpSpeed(2, 3.5); # was 3.5
  669.     Sleep(0.01);
  670.     SetCameraSecondaryFocus(2, c_t3);
  671.     SetCameraFOV(100, 1, 3.5); # was 3.5
  672.  
  673.     # Pose Indy...
  674.     Sleep(2.0);
  675.  
  676.     # Finish ringer move...
  677.     AIWaitForStop(bellringer);
  678.     Sleep(0.1);
  679.     StopKey(bellringer, br_keyTrack1, 0.0);
  680.  
  681.     # TO DO: drop in sound of ringer hitting bell
  682.     StopSound(BRrollingloop, 0.0);
  683.     StopSound(BRspinloop, 0.0);
  684.     
  685.     # Temp, need callback to synch properly
  686.     PlaySoundLocal(musBRringing, 1.0, 0, 0x0000, 0);
  687.  
  688.     Sleep(0.3);
  689.     DetachThing(c_t2_br);
  690.     DestroyThing(c_t2_br);
  691.     
  692.     # Now ringer retreats...
  693.     AIDisableHeadTracking(indy);
  694.     AISetLookThing(indy, oldlady);
  695.     AISetMoveThing(bellringer, br_mk1, 0);
  696.     
  697.     PlaySoundLocal(sndBRrolling, 1.0, 0, 0x0000, 0);
  698.     PlaySoundLocal(sndBRspin, 1.0, 0, 0x0000, 0);
  699.     
  700.     br_keyTrack1 = PlayKey(bellringer, br_back, 4, 0x10, 0);
  701.     Sleep(1.5);
  702.  
  703.     # Raise bell...
  704.     SendMessage(bellcog, user2);
  705.  
  706.     # Zoom in on Holy Woman...
  707.     SetCameraLookInterp(2, 0); # stop interping for a while
  708.     Sleep(0.01);
  709.     SetCameraSecondaryFocus(2, c_t4);
  710.     SetCameraFOV(40, 1, 6.0);
  711.     MoveToFrame(c_t4, 1, 0.24);
  712.  
  713.     # Reset bellringer...
  714.     StopKey(bellringer, br_keyTrack1, 0.0);
  715.     StopThing(bellringer);
  716.     TeleportThing(bellringer, br_mk1);
  717.     Sleep(0.1); # magic sleep that cures c_t2_br target placement on re-tries!
  718.     SetThingFlags(bellringer, 0x80000); # hide
  719.     
  720.     ClearThingFlags(CTbellringer, 0x80000); # reveal
  721.     # Send user2 to reset CT BR
  722.     SendMessage(ringercog, user2);
  723.     
  724.     ringerState = 0;
  725.  
  726.     # She seems confused...
  727.     ol_keyTrack1 = PlayKey(oldlady, ol_confused, 2, 0x12, 0);
  728.     Sleep(1.5);
  729.  
  730.     # Holy Woman turns toward Indy...
  731.     StopKey(oldlady, ol_keyTrack1, 0.5);
  732.     AISetLookThing(oldlady, indy);
  733.     Sleep(2.2);
  734.  
  735.     # Start Indy toward Holy Woman...
  736.     AISetMoveSpeed(indy, 1.0);
  737.     AISetLookThing(indy, oldlady);
  738.     AISetMoveThing(indy, in_mk3, 0);
  739.  
  740.     # Holy Woman:  "Hello, young man.  You rang?"
  741.     ol_keyTrack1 = PlayKey(oldlady, ol_stand2honcane, 2, 0x10, 0);
  742.     PlayKey(oldlady, ol_wavecane2, 4, 0x12, 0);
  743.     Sleep(0.5);
  744.     StopThing(oldlady); # stop that damn churning
  745.     PlayVoice(oldlady, ol_rang, 1.0, 1);
  746.  
  747.     # Pan to frame both actors...
  748.     AIWaitForStop(indy);
  749.     Sleep(0.01);
  750.     AISetLookThing(indy, oldlady); # make him look down at her
  751.     AISetLookThing(oldlady, indy); # and she looks up
  752.  
  753.     # Indy: "That's right, I did."
  754.     PlayKey(indy, in_ltarmup, 4, 0x12, 0);
  755.     PlayVoice(indy, in_thatsright, 1.0, 1);
  756.  
  757.     # Holy Woman: "And you want my help."
  758.     PlayVoice(oldlady, ol_wanthelp, 1.0, 1);
  759.  
  760.     # Cut to Indy over Holy Woman's shoulder...
  761.     Sleep(0.01);
  762.     SetCameraFocus(2, cam_4);
  763.     SetCameraSecondaryFocus(2, c_t5);
  764.     SetCameraFOV(37, 0, 0.0);
  765.  
  766.     # Indy: "Do I...I'm...lost."
  767.     curSound = PlayVoice(indy, in_lost, 1.0, 0);
  768.     Sleep(0.5);
  769.     PlayKey(indy, in_botharmsup, 4, 0x12, 0);
  770.     WaitForSound(curSound);
  771.  
  772.     # Cut to reverse on Holy Woman over Indy's shoulder...
  773.     SetCameraLookInterp(2, 0);
  774.     Sleep(0.01);
  775.     SetCameraFocus(2, cam_5);
  776.     SetCameraSecondaryFocus(2, c_t6);
  777.     SetCameraFOV(29, 0, 0.0);
  778.  
  779.     # Holy Woman: "But it is you who must help me...spinning idol...legacy..."
  780.     curSound = PlayVoice(oldlady, ol_youhelpme, 1.0, 0); # line split
  781.  
  782.     # Long slow push in...
  783.     MoveToFrame(c_t6, 1, 0.01);
  784.     SetCameraFOV(22, 1, 15.0);
  785.     PlayKey(oldlady, ol_ltwave, 4, 0x12, 0);    
  786.     Sleep(7.5);
  787.     PlayKey(oldlady, ol_ltwave, 4, 0x12, 0);    
  788.     Sleep(2.5);
  789.     curSound = PlayVoice(oldlady, ol_evillegacy, 1.0, 0); #line split
  790.     Sleep(3.0);
  791.     PlayKey(oldlady, ol_wavecane2, 4, 0x12, 1);
  792.     WaitForSound(curSound);
  793.     Sleep(0.3); # take a beat
  794.  
  795.     # Cut to Indy again...
  796.     SetCameraLookInterp(2, 0);
  797.     Sleep(0.01);
  798.     SetCameraFocus(2, cam_4);
  799.     SetCameraSecondaryFocus(2, c_t5);
  800.     SetCameraFOV(37, 0, 0.0);
  801.  
  802.     # Indy: "Show me the way."
  803.     PlayKey(indy, in_rtarmup, 4, 0x12, 0);    
  804.     PlayVoice(indy, in_showmeway, 1.0, 1);
  805.  
  806.     # Holy Woman turns and walks away from Indy...
  807.     StopKey(oldlady, ol_keyTrack1, 0.0);
  808.     SetThingMaxRotVel(oldlady, 175.0);
  809.     AISetLookThing(oldlady, ol_mk1);
  810.     Sleep(0.2);
  811.  
  812.     # Holy Woman: "I am too old and infirm...golden treasure."
  813.     curSound = PlayVoice(oldlady, ol_goldtreasure, 1.0, 0); # line split
  814.  
  815.     # Dolly back to keep her framed...
  816.     AISetMoveSpeed(oldlady, 0.7);
  817.     AISetMoveThing(oldlady, ol_mk1, 0);
  818.     SetCameraLookInterp(2, 1);
  819.     SetCameraPosInterp(2, 1);
  820.     SetCameraInterpSpeed(2, 4.1);
  821.     Sleep(0.01);
  822.     SetCameraFocus(2, cam_6);
  823.     SetCameraSecondaryFocus(2, c_t7);
  824.     SetCameraFOV(45, 1, 0.8);
  825.     headLookThing = oldlady;
  826.     AIEnableHeadTracking(indy, headLookThing);
  827.     AIWaitForStop(oldlady);
  828.     Sleep(6.5);
  829.  
  830.     # Holy Woman turns back toward Indy...
  831.     AIEnableHeadTracking(oldlady, indy);
  832.     AISetLookThing(oldlady, indy);
  833.     Sleep(0.5);
  834. #    ol_keyTrack1 = PlayKey(oldlady, ol_stand2honcane, 2, 0x10, 0);
  835.     PlayKey(oldlady, ol_pointcane, 4, 0x12, 0);
  836.  
  837.     # Indy walks up to her...
  838.     AISetLookThing(indy, oldlady);
  839.     AISetMoveThing(indy, in_mk4, 0);
  840.     SetCameraLookInterp(2, 0);
  841.     Sleep(0.01);
  842.     MoveToFrame(c_t7, 1, 0.14); # tilt up as Indy approaches
  843.     Sleep(0.01);
  844.     AIWaitForStop(indy);
  845.     AIDisableHeadTracking(indy);
  846.     AIDisableHeadTracking(oldlady);
  847.     AISetLookThing(indy, oldlady);
  848.  
  849.     # Indy: "Okay...golden treasure..."
  850.     WaitForSound(curSound);
  851.     curSound = PlayVoice(indy, in_whereisit, 1.0, 0);
  852.     Sleep(1.5);
  853.     PlayKey(indy, in_ltarmup, 4, 0x12, 0);
  854.     WaitForSound(curSound);
  855.  
  856.     # Cut to single shot of Holy Woman...
  857.     SetCameraPosInterp(2, 0);
  858.     Sleep(0.01);
  859.     SetCameraFocus(2, cam_7);
  860.     SetCameraSecondaryFocus(2, c_t8);
  861.     SetCameraFOV(35, 0, 0.0);
  862.     SetThingFlags(indy, 0x10); # invisible
  863.  
  864.     # Holy Woman: "Why, in the treasury, of course!"
  865.     curSound = PlayVoice(oldlady, ol_treasury, 1.0, 0);
  866.     Sleep(0.5);
  867.     PlayKey(oldlady, ol_wavecane2, 4, 0x12, 1);
  868.     StopKey(oldlady, ol_keyTrack1, 0.0);
  869.     ol_keyTrack1 = PlayKey(oldlady, ol_standwkey, 2, 0x10, 0);
  870.     ol_swapCase = 1; # swap oldlady key hand
  871.     PlayKey(oldlady, ol_showkey, 4, 0x12, 0);
  872.     WaitForSound(curSound);
  873.     Sleep(0.3);
  874.  
  875.     # Cut to full side shot of both actors...
  876.     SetCameraFocus(2, cam_8);
  877.     SetCameraSecondaryFocus(2, c_t9);
  878.     SetCameraFOV(70, 0, 0.0);
  879.     ClearThingFlags(indy, 0x10); # visible again
  880.  
  881.     # Holy Woman: "Take this, it may help you."
  882.     curSound = PlayVoice(oldlady, ol_takekey, 1.0, 0);
  883.  
  884.     # She gives Indy the key...
  885.     Sleep(1.5);
  886.     StopKey(oldlady, ol_keyTrack1, 0.0);
  887.     ol_keyTrack1 = PlayKey(oldlady, ol_basicstand, 2, 0x10, 0);
  888.     PlayKey(oldlady, ol_givekey, 4, 0x12, 0);
  889.     in_swapCase = 1; # swap indy key hand
  890.     PlayKey(indy, in_takekey, 4, 0x12, 1);
  891.     StopKey(oldlady, ol_keyTrack1, 0.5);
  892.     WaitForSound(curSound);
  893.  
  894.     # Key zips into inventory...
  895.     ChangeInv(player, oldladykey, 1.0); # add key to inventory bin
  896.     SetInvAvailable(player, oldladykey, 1); # make it available for use
  897.     JonesInvItemChanged(oldladykey); # show acquisition
  898.  
  899.     # Prep Holy Woman for follow-up chat that might occur before Indy leaves area...
  900.     SetThingCollideSize(oldlady, 0.06); # set correct talk distance
  901.     SetThingMass(oldlady, 0); # make her immoveable
  902.     AIClearCutSceneMode(oldlady); 
  903.     AIClearCutSceneMode(indy);
  904.  
  905.     return;
  906.  
  907. # ...................................................................
  908.  
  909. noring:
  910.  
  911.     # Reposition Indy...
  912.     TeleportThing(indy, in_mk6);
  913.     Sleep(0.01);
  914.     AISetLookThing(indy, in_mk7);
  915.  
  916.     # Cut inside tower...
  917.     SetCameraLookInterp(2, 0); # no pan & tilt
  918.     SetCameraFocus(2, cam_3);
  919.     SetCameraSecondaryFocus(2, bellringer);
  920.     SetCameraFOV(80, 0, 0.0);
  921.     Sleep(0.01);
  922.  
  923.     # Finish ringer move...
  924.     AIWaitForStop(bellringer);
  925.     StopKey(bellringer, br_keyTrack1, 0.0);
  926.     StopSound(BRrollingloop, 0.0);
  927.     StopSound(BRspinloop, 0.0);
  928.     Sleep(0.3);
  929.     DetachThing(c_t2_br);
  930.     DestroyThing(c_t2_br);
  931.  
  932.     # Now it retreats...
  933.     SetCameraLookInterp(2, 1); # allow pan & tilt
  934.     SetCameraInterpSpeed(2, 5.5);
  935.     AISetMoveThing(bellringer, br_mk1, 0);
  936.     PlaySoundLocal(sndBRrolling, 1.0, 0, 0x0000, 0);
  937.     PlaySoundLocal(sndBRspin, 1.0, 0, 0x0000, 0);
  938.     br_keyTrack1 = PlayKey(bellringer, br_back, 4, 0x10, 0);
  939.     Sleep(0.01);
  940.     SetCameraSecondaryFocus(2, c_t1);
  941.     SetCameraFOV(28, 1, 5.5);
  942.  
  943.     # Pose Indy...
  944.     Sleep(2.0);
  945.     AIDisableHeadTracking(indy);
  946.     Sleep(1.5);
  947.  
  948.     # Reset bellringer...
  949.     StopKey(bellringer, br_keyTrack1, 0.0);
  950.     StopThing(bellringer);
  951.     TeleportThing(bellringer, br_mk1);
  952.     Sleep(0.1); # this is a magic sleep that cures target placement on re-tries!
  953.     
  954.     SetThingFlags(bellringer, 0x80000); # hide
  955.     # Send user2 to reset CT BR
  956.     SendMessage(ringercog, user2);
  957.     ClearThingFlags(CTbellringer, 0x80000); # reveal
  958.     ringerState = 0;
  959.  
  960.     # Indy comments...
  961.  
  962.     if (noRingComment == 0 && bellRangAlready == 0)
  963.     {
  964.         noRingComment = 1;
  965.         in_keyTrack1 = PlayKey(indy, in_armsCrossed, 2, 0x10, 0);
  966.         PlayKey(indy, in_crossArms, 4, 0x12, 0);
  967.         PlayVoice(indy, in_notgoodenough, 1.0, 1);
  968.     }
  969.     else
  970.     {
  971.         in_keyTrack1 = PlayKey(indy, in_armsCrossed, 2, 0x10, 0);
  972.         PlayKey(indy, in_crossArms, 4, 0x12, 1);
  973.         PlayVoice(indy, in_hmm, 1.0, 1);
  974.     }
  975.  
  976.     StopKey(indy, in_keyTrack1, 1.0);
  977.     Sleep(0.8);
  978.  
  979.     SetCameraLookInterp(2, 0); # no pan & tilt
  980.  
  981.     return;
  982.  
  983. # ...................................................................
  984.  
  985. noroll:
  986.  
  987.     ringerState = 0;
  988.     if (camexists == 0) 
  989.     {
  990.         norollcam=creatething(ghost_tpl, cam_1); # create a camera at cam_1 pos
  991.         CaptureThing(norollcam);
  992.         camexists=1;
  993.     }
  994.     Sleep(1.0);
  995.     AISetLookThing(indy, cam_3);
  996.     
  997.     SetCameraLookInterp(2, 1); 
  998.     SetCameraInterpSpeed(2, .3);
  999.     Sleep(0.01);
  1000.     SetCameraFocus(2, norollcam);            # switch to dolly cam
  1001.     SetCameraSecondaryFocus(2, indy);
  1002.     SetCameraFOV(75, 1, 1.0);
  1003.     sleep(.3);
  1004.     SetCameraLookInterp(2, 0);
  1005.  
  1006.     AttachThingToThing(norollcam, indy);    # glue it to Indy
  1007.     AISetMoveSpeed(indy, .7);
  1008.     AISetMoveThing(indy, in_mk6, 1);         # so Indy returns visible
  1009.     
  1010.     # have Indy turn head towards gate    
  1011.     AISetLookThingEyeLevel(indy, in_mk7);
  1012.  
  1013.     in_keyTrack1 = PlayKey(indy, in_handsOnHips, 2, 0x10, 0);
  1014.     PlayKey(indy, in_handsToHips, 4, 0x12, 1);
  1015.  
  1016.     if (noRollComment == 0)
  1017.     {
  1018.         noRollComment = 1;
  1019.         PlayKey(indy, in_PushHat, 4, 0x12, 0);
  1020.         PlayVoice(indy, in_nowork, 1.0, 1);
  1021.     }
  1022.     else
  1023.     {
  1024.         PlayVoice(indy,in_somethingwrong, 1.0, 1);
  1025.     }
  1026.  
  1027.     Sleep(0.5);
  1028.     StopKey(indy, in_keyTrack1, 0.5);
  1029.     Sleep(0.5);
  1030.  
  1031.     return;
  1032.  
  1033. # ...................................................................
  1034.  
  1035. backtoplay:
  1036.  
  1037.     # restore player control...
  1038.     leverState = 0;
  1039.     SetThingMaxRotVel(indy, in_rotRate);
  1040.     CopyOrientAndPos(indy, player); # move player to actor's spot
  1041.     SetThingFlags(indy, 0x80000); # hide actor    
  1042.     camPos = GetThingPOS(camPosThing); 
  1043.     SetCameraPosition(1, camPos); # prep to swing back to follow-cam
  1044.     SetCameraLookInterp(2, 0); # kill pan & tilt mode
  1045.     SetCameraPosInterp(2, 0); # kill dolly mode
  1046.     ClearThingFlags(player, 0x80000); # player visible
  1047.     ClearActorFlags(player, 0x200000); # player in control
  1048.     SetCurrentCamera(curCam);
  1049.     ResetCameraFOV(0, 0.0);
  1050.     
  1051.     if (camExists != 0)
  1052.         DestroyThing(norollcam);    # resets
  1053.     camexists=0;
  1054.  
  1055.     EndCutscene();
  1056.  
  1057.     return;
  1058.  
  1059. # ...................................................................
  1060.  
  1061. morechat:
  1062.  
  1063.     # Prep...
  1064.     StartCutscene(1);
  1065.     SetActorFlags(player, 0x200000); # remove player controls
  1066.     ClearThingFlags(indy, 0x80000); # summon actor
  1067.     SetThingFlags(indy, 0x10); # make actor present but invisible
  1068.     TeleportThing(indy, player); # plant actor indy at player location
  1069.     Sleep(0.01);
  1070.  
  1071.     # Align Indy and Holy Woman...
  1072.     if (sender == oldlady)
  1073.     {
  1074.         AISetCutSceneMode(oldlady);
  1075.         Sleep(0.01);
  1076.         headLookThing = oldlady;
  1077.         AISetLookThing(indy, oldlady);
  1078.         AISetLookThing(oldlady, indy);
  1079.     }
  1080.     else
  1081.     {
  1082.         AISetCutSceneMode(younglady);
  1083.         Sleep(0.01);
  1084.         SetThingMaxRotVel(younglady, 125.0);
  1085.         headLookThing = younglady;
  1086.         AISetLookThing(indy, younglady);
  1087.         AISetLookThing(younglady, indy);
  1088.     }
  1089.     Sleep(0.5); # allow time to line up
  1090.  
  1091.     # Align follow-cam by aligning player to our actor...
  1092.     CopyOrientAndPos(indy, player);
  1093.  
  1094.     # Now show actor and hide player...
  1095.     CopyPlayerHolsters(player, indy);
  1096.     ClearThingFlags(indy, 0x10); # show him
  1097.     SetThingFlags(player, 0x80000); # hide player    
  1098.     Sleep(0.01);
  1099.  
  1100.     AIEnableHeadTracking(indy, headLookThing);
  1101.  
  1102.     SetExtCamOffset('0.14 -0.09 0.055'); # interp cam out to right
  1103.  
  1104.     Sleep(0.5);
  1105.  
  1106.     AIDisableHeadTracking(indy);
  1107.  
  1108.     if (cutSceneState == 3)
  1109.     {
  1110.         # If the big bronze doors are already open...
  1111.         call iceprompt;
  1112.         AIClearCutSceneMode(younglady);
  1113.     }
  1114.     else
  1115.     {
  1116.         if (GetInv(player, plantbud) == 1)
  1117.         {
  1118.             # If Indy has the budding plant, finish the scene right now...
  1119.             call givetreasure;
  1120.             camPos = GetThingPOS(cam_9); 
  1121.             SetCameraPosition(1, camPos); # prep to swing back to follow-cam
  1122.             AIClearCutSceneMode(younglady);
  1123.         }
  1124.         else
  1125.         {        
  1126.             if (GetInv(player, plantleaf) == 1)
  1127.             {
  1128.                 # NOTE:  whoops, there are no lines for being partly-done...
  1129.                 call gotbulb;
  1130.                 AIClearCutSceneMode(oldlady);
  1131.             }
  1132.             else
  1133.             {
  1134.                 if (GetInv(player, plantbulb) == 1)
  1135.                 {
  1136.                     call gotbulb;
  1137.                     AIClearCutSceneMode(oldlady);
  1138.                 }
  1139.                 else
  1140.                 {
  1141.                     call noprogress;
  1142.                     AIClearCutSceneMode(oldlady);
  1143.                 }
  1144.             }
  1145.         }
  1146.     }
  1147.  
  1148.     # Restore player control...
  1149.     CopyOrientAndPos(indy, player); # pop player to actor spot
  1150.     SetThingFlags(indy, 0x80000); # hide actor    
  1151.     ClearThingFlags(player, 0x80000); # player visible
  1152.     ClearActorFlags(player, 0x200000); # player in control
  1153.     SetThingMaxRotVel(indy, in_rotRate);
  1154.     SetCurrentCamera(curCam);
  1155.     RestoreExtCam();
  1156.     ResetCameraFOV(0, 0.0);
  1157.     EndCutscene();
  1158.         
  1159.     return;
  1160.     
  1161. # ...................................................................
  1162.  
  1163. noprogress:
  1164.         
  1165.     # Holy Woman: "Where's the golden treasure?"
  1166.     if (cutSceneState == 0)
  1167.     {
  1168.         # cutSceneState = 1; # only read this line once
  1169.         PlayVoice(oldlady, ol_hello2, 1.0, 1);
  1170.     }
  1171.     else
  1172.     {
  1173.         PlayVoice(oldlady, ol_hello3, 1.0, 1);
  1174.     }
  1175.  
  1176.     # Indy: "I haven't found it yet."
  1177.     in_keyTrack1 = PlayKey(indy, in_handsOnHips, 2, 0x10, 0);
  1178.     PlayKey(indy, in_handsToHips, 4, 0x12, 1);
  1179.     curSound = PlayVoice(indy, in_notfoundyet, 1.0, 1);
  1180.  
  1181.     # TO DO: Get ol animation that returns to stand1, not 2
  1182.     PlayKey(oldlady, ol_pointcane, 4, 0x12, 0);
  1183.  
  1184.     if (cutSceneState == 0)
  1185.     {
  1186.         # Holy Woman: "Examine the treasury!"
  1187.         PlayVoice(oldlady, ol_looktreasury, 1.0, 1);
  1188.     }
  1189.     else
  1190.     {
  1191.         # Holy Woman: "Follow the water."
  1192.         PlayVoice(oldlady, ol_followwater, 1.0, 1);
  1193.     }
  1194.  
  1195.     cutSceneState = 1;
  1196.  
  1197.     StopKey(indy, in_keyTrack1, 0.5);
  1198.     Sleep(0.5);
  1199.  
  1200.     return;
  1201.  
  1202. # ...................................................................
  1203.  
  1204. gotbulb:
  1205.  
  1206.     # Holy Woman: "Peace, young man.  Where's the treasure?"
  1207.     PlayVoice(oldlady, ol_hello3, 1.0, 1);
  1208.  
  1209.     # Indy: "All I've found is a plant bulb."
  1210.     curSound = PlayVoice(indy, in_foundbulbA, 1.0, 0);
  1211.     PlayKey(indy, in_botharmsup, 4, 0x12, 1);
  1212.     WaitForSound(curSound);
  1213.  
  1214.     if (cutSceneState < 2)
  1215.     {
  1216.         # Indy: "Not much of a treasure..."
  1217.         curSound = PlayVoice(indy, in_foundbulbb, 1.0, 0);
  1218.         PlayKey(indy, in_ltarmup, 4, 0x12, 1);
  1219.         WaitForSound(curSound);    
  1220.     }
  1221.         
  1222.     if (cutSceneState < 2)
  1223.     {
  1224.         # Holy Woman: "Yet it must become one..."
  1225.         curSound = PlayVoice(oldlady, ol_mustbecome, 1.0, 0);
  1226.         PlayKey(oldlady, ol_pointcane, 4, 0x12, 0);
  1227.     }
  1228.     else
  1229.     {
  1230.         # Holy Woman: "Remember...living things need loving care."
  1231.         curSound = PlayVoice(oldlady, ol_livingloving, 1.0, 0);
  1232.         PlayKey(oldlady, ol_ltwave, 4, 0x12, 0);
  1233.     }
  1234.     WaitForSound(curSound);
  1235.  
  1236.     cutSceneState = 2;
  1237.  
  1238.     Sleep(0.5);
  1239.  
  1240.     return;
  1241.     
  1242. # ...................................................................
  1243.  
  1244. givetreasure:
  1245.  
  1246.     # Door stuff fix for bugs,etc  (JC)
  1247.  
  1248.     # Destroy static closed doors
  1249.     DestroyThing(ldoorclose);
  1250.     DestroyThing(rdoorclose);
  1251.  
  1252.     # Put animated doors in play
  1253.     ClearThingFlags(leftdoor, 0x80000);
  1254.     ClearThingFlags(rightdoor, 0x80000);
  1255.  
  1256.     # Prep camera...
  1257.     SetCameraLookInterp(2, 0);
  1258.  
  1259.     # gestures
  1260.  
  1261.     # Holy Woman: "You again.  Do you have the treasure?"
  1262.     PlayVoice(oldlady, ol_gottreasure, 1.0, 1);
  1263.  
  1264.     # Indy: "Here's the best I could do..."
  1265.     in_swapCase = 2; # indy swapping plant
  1266.     curSound = PlayVoice(indy, in_bestdo, 1.0, 0);
  1267.     PlayKey(indy, in_plantready, 2, 0x12, 1);
  1268.  
  1269.     # Indy gives her the budding plant...
  1270.     PlayKey(indy, in_giveplant, 4, 0x12, 0);
  1271.     ol_swapCase = 2; # oldlady swapping plant
  1272.     ol_keyTrack1 = PlayKey(oldlady, ol_stand2honcane, 2, 0x0, 0);
  1273.     PlayKey(oldlady, ol_takeplantA, 4, 0x12, 1);
  1274.     StopKey(oldlady, ol_keyTrack1, 0.0);
  1275.     in_swapCase = 0; # indy swaps no more
  1276.     Sleep(0.01);
  1277.  
  1278.     # Cut to close-up of Holy Woman...
  1279.     SetCameraFocus(2, cam_9);
  1280.     SetCameraSecondaryFocus(2, c_t10);
  1281.     SetCurrentCamera(2);
  1282.     SetCameraFOV(35, 0, 0.0);
  1283.     CopyOrient(ol_plantspot, oldlady); # snap her to proper orientation
  1284.     SetThingFlags(indy, 0x10); # invisible
  1285.  
  1286.     # She takes the plant...
  1287.     PlayKey(oldlady, ol_takeplantB, 4, 0x12, 1);
  1288.  
  1289.     # Holy Woman: "Not yet."
  1290.     ol_keyTrack1 = PlayKey(oldlady, ol_lookatbud, 2, 0x14, 0);
  1291.     WaitForSound(curSound);
  1292.     PlayVoice(oldlady, ol_notyet, 1.0, 1);
  1293.     Sleep(0.25);
  1294.  
  1295.     # Lose plant from Indy's inventory...
  1296.     ChangeInv(player, plantbud, -1.0);
  1297.  
  1298.     # Substitute young woman for old...
  1299.     StopKey(oldlady, ol_keyTrack1, 0.0);
  1300.     CopyOrientAndPos(oldlady, younglady); # young woman into position
  1301.     SetThingFlags(oldlady, 0x80000); # hide old    
  1302.     ClearThingFlags(younglady, 0x80000); # reveal young
  1303.     ol_swapCase = 0; # oldlady swaps no more
  1304.     DestroyThing(oldlady);
  1305.     AISetCutSceneMode(younglady);
  1306.     yl_keyTrack1 = PlayKey(younglady, yl_bentover, 2, 0x10, 0);
  1307.  
  1308.     # Cut to close-up of the plant as it bursts into bloom...
  1309.     SetCameraFocus(2, cam_10);
  1310.     SetCameraSecondaryFocus(2, c_t11);
  1311.     SetCameraFOV(20, 0, 0.0);
  1312.     ClearThingFlags(plant, 0x80000); # now you see it
  1313.     plt_keyTrack1 = PlayKey(plant, plant_wait, 2, 0x10, 0); # hold on bud
  1314.     Sleep(0.1);
  1315.     PlayKey(plant, plant_bloom, 4, 0x12, 0);
  1316.  
  1317.     # Start music
  1318.     PlaySoundLocal(musYL, 1.0, 0, 0x0000, 0);
  1319.  
  1320.     # RT: Make some fairy dust...
  1321.     for (index = 0; index < 16; index = index + 1)
  1322.     {
  1323.         CreateThingAtPos(fairyDust_tpl, GetThingSector(plant), VectorAdd(GetThingPos(plant), '0 0 0.025'), '0 0 0');
  1324.         Sleep(0.2);
  1325.     }
  1326.  
  1327.     Sleep(0.5); # RT: Was 3.7 -- changed to account for fairy dust sleeps
  1328.  
  1329.     # Camera tilts up and widens view to reveal young Holy Woman...
  1330.     StopKey(plant, plt_keyTrack1, 0.0);
  1331.     SetCameraFOV(33, 1, 1.5);
  1332.     MoveToFrame(c_t11, 1, 0.47); # tilt up
  1333.     Sleep(0.5);
  1334.     StopKey(younglady, yl_keyTrack1, 0.0);
  1335.     yl_keyTrack1 = PlayKey(younglady, yl_upright, 2, 0x10, 0);
  1336.     yl_swapCase = 1; # RT: So we know when to start VFX
  1337.     PlayKey(younglady, yl_transform, 4, 0x12, 0);
  1338.  
  1339.     Sleep(1.5);
  1340.  
  1341.     # Cut to Indy reacting...
  1342.     CopyOrientAndPos(in_mk5, indy); # move indy into position
  1343.     SetCameraFocus(2, cam_11);
  1344.     SetCameraSecondaryFocus(2, c_t12);
  1345.     SetCameraFOV(30, 0, 0.0);
  1346.     SetThingFlags(plant, 0x80000); # hide
  1347.     SetThingFlags(younglady, 0x10); # hide
  1348.     ClearThingFlags(indy, 0x10); # show him
  1349.  
  1350.     # RT: Do some model swapping...
  1351.     yl_swapRefPlant = SetThingMesh(younglady, 21, mod_yl_hand_bloom, 0); # younglady swap plant in offscreen
  1352.     yl_swapRefCane = SetThingMesh(younglady, 17, mod_yl_hand_cane, 0); # younglady swap cane in offscreen
  1353.  
  1354.     PlayKey(indy, in_wow, 4, 0x12, 1);
  1355.  
  1356.     # Cut back to Holy Woman holding plant...
  1357.     SetCameraFocus(2, cam_12);
  1358.     SetCameraSecondaryFocus(2, c_t13);
  1359.     SetCameraFOV(43, 0, 0.0); # was 40
  1360.     ClearThingFlags(younglady, 0x10); # she's back
  1361.     SetThingFlags(indy, 0x10); # hide him
  1362.     StopKey(younglady, yl_keyTrack1, 0.0);
  1363.     yl_keyTrack1 = PlayKey(younglady, yl_standwf, 2, 0x10, 0);
  1364.     Sleep(0.01);
  1365.  
  1366.     # Holy Woman throws cane...
  1367.     ClearThingFlags(flyingcane, 0x80000); # summon cane
  1368.     SetThingFlags(flyingcane, 0x10); # make it invisible
  1369.     yl_swapCase = 2; # younglady swaps cane
  1370.     PlayKey(younglady, yl_losecane, 4, 0x12, 0);  
  1371.     can_keyTrack1 = PlayKey(flyingcane, cane_fly, 4, 0x14, 0); # synch animations
  1372.     Sleep(0.6);
  1373.     ClearThingFlags(flyingcane, 0x10); # now see cane
  1374.     PlaySoundLocal(sndCaneThrow, 1.0, 0, 0x0000, 0);
  1375.  
  1376.     # Holy Woman: "Ahhh!  Your gift is great!  Now..."
  1377.     curSound = PlayVoice(younglady, yl_greatgift, 1.0, 0);
  1378.  
  1379.     # Cane disappears...
  1380.     Sleep(0.5);
  1381.     StopKey(flyingcane, can_keyTrack1, 0.0);
  1382.     SetThingFlags(flyingcane, 0x80000); # cane is gone
  1383.     WaitForSound(curSound);
  1384.     
  1385.     # music
  1386.     PlaySoundLocal(musStrange, .5, 0, 0x0000, 0);
  1387.     
  1388.  
  1389.     # Prep Holy Woman to unlock & open doors...
  1390.     AttachThingToThing(c_t13, younglady);
  1391.     SetThingMaxRotVel(younglady, 125.0);
  1392.     AISetMoveSpeed(younglady, 1.2);
  1393.     SetCollideType(barlock, 0);
  1394.     SetCollideType(leftdoor, 0);
  1395.     SetCollideType(rightdoor, 0);
  1396.  
  1397.     # Holy Woman walks to flower stand...
  1398.     SetArmedMode(younglady, 1); # causes walking with plant
  1399.     Sleep(0.01);
  1400.     StopKey(younglady, yl_keyTrack1, 0.0);
  1401.     AISetLookThing(younglady, yl_mk1);
  1402.     AISetMoveThing(younglady, yl_mk1, 0);
  1403.     MoveToFrame(c_t13, 1, 0.12);
  1404.     AIWaitForStop(younglady);
  1405.  
  1406.     # Holy Woman deposits flower on stand...
  1407.     yl_swapCase = 3; # younglady swaps plant
  1408.     PlayKey(younglady, yl_putflower, 4, 0x12, 1);
  1409.     ClearThingFlags(static_flower, 0x80000);
  1410.     SetArmedMode(younglady, 0); # cease walking with plant
  1411.  
  1412.     # Holy Woman walks to bar...
  1413.     SetCameraInterpSpeed(2, 3.5);
  1414.     SetCameraLookInterp(2, 1);
  1415.     Sleep(0.01);
  1416.     SetCameraSecondaryFocus(2, c_t14);
  1417.     SetCameraFOV(90, 1, 3.5);
  1418.     AISetLookThing(younglady, yl_mk2);
  1419.     AISetMoveThing(younglady, yl_mk2, 0);
  1420.     AIWaitForStop(younglady);
  1421.     Sleep(0.01);
  1422.  
  1423.     # Holy Woman heaves bar aside...
  1424.     CopyOrient(yl_mk2, younglady); # snap her to proper orientation
  1425.     bar_keyTrack1 = PlayKey(barlock, bar_flip, 4, 0x14, 0); # hold forever!
  1426.  
  1427.     # RT: Callback starts the bar sound...
  1428.     yl_swapCase = 4;
  1429.     yl_keyTrack1 = PlayKey(younglady, yl_throwbar, 4, 0x12, 0);
  1430.     Sleep(2.0);
  1431.     StopKey(younglady, yl_keyTrack1, 0.0);
  1432.  
  1433.     # Holy Woman walks to middle of the doors...
  1434.     AISetLookThing(younglady, yl_mk3);
  1435.     AISetMoveThing(younglady, yl_mk3, 0);
  1436.     Sleep(1.0);
  1437.     AISetLookThing(younglady, yl_mk5);
  1438.     AIWaitForStop(younglady);
  1439.  
  1440.     # Holy Woman slams open the doors...
  1441.     CopyOrient(yl_mk3, younglady); # snap her to face doors
  1442.     Sleep(0.01);
  1443.     ldr_keyTrack1 = PlayKey(leftdoor, ldr_open, 4, 0x14, 0); # hold forever!
  1444.     rdr_keyTrack1 = PlayKey(rightdoor, rdr_open, 4, 0x14, 0); # hold forever!
  1445.  
  1446.     # RT: Callback starts the door sound...
  1447.     yl_swapCase = 5;
  1448.     SetPulse(.1); # camera shake
  1449.     PlayKey(younglady, yl_opendoors, 4, 0x12, 1);
  1450.     SetPulse(0.0);
  1451.  
  1452.     # ...and stands aside...
  1453.     CopyOrientAndPos(yl_mk4, younglady); # move her to final mark
  1454.     AISetLookThing(younglady, indy); # focus on Indy
  1455.     SetCameraLookInterp(2, 0);
  1456.     Sleep(0.01);
  1457.     SetCameraFocus(2, cam_13);
  1458.     SetCameraSecondaryFocus(2, c_t15);
  1459.     SetCameraFOV(63, 0, 0.0);
  1460.     # AISetLookThing(younglady, indy);
  1461.  
  1462.     # swap the animated lock and doors for statics...
  1463.     DestroyThing(barlock);
  1464.     ClearThingFlags(barup, 0x80000);
  1465.     DestroyThing(leftdoor);
  1466.     ClearThingFlags(ldooropen, 0x80000);
  1467.     DestroyThing(rightdoor);
  1468.     ClearThingFlags(rdooropen, 0x80000);
  1469.  
  1470.     # Holy Woman: "Here is the way to the Babylonian curse..."
  1471.     curSound = PlayVoice(younglady, yl_waytocurse, 1.0, 0);
  1472.     PlayKey(younglady, yl_armspointway, 4, 0x12, 1);
  1473.     Sleep(1.5);
  1474.     PlayKey(younglady, yl_armsup, 4, 0x12, 1);
  1475.     WaitForSound(curSound);
  1476.  
  1477.     # play music
  1478.     PlaySoundLocal(musEerie, .5, 0.0, 0x0, 0);
  1479.     
  1480.     # Clean up and prep for residual chat...
  1481.     ClearThingFlags(indy, 0x10); # see him again
  1482.     SetThingCollideSize(younglady, 0.06); # set correct talk distance
  1483.     SetThingMass(younglady, 0); # make her immoveable
  1484.     AIClearCutSceneMode(younglady);
  1485.     
  1486.     cutSceneState = 3; # doors are OPEN
  1487.  
  1488.     return;
  1489.  
  1490. # ...................................................................
  1491.  
  1492. iceprompt:
  1493.         
  1494.     # Holy Woman: "Beware the ice..."
  1495.     PlayKey(younglady, yl_lthandup, 4, 0x12, 0);
  1496.     PlayVoice(younglady, yl_bewareice, 1.0, 1);
  1497.     Sleep(0.2);
  1498.  
  1499.     return;
  1500.     
  1501. # ...................................................................
  1502.  
  1503. doorbarred:
  1504.  
  1505.     SetActorFlags(player, 0x200000);
  1506.     StartCutScene(0);
  1507.     
  1508.     # Prep indy...
  1509.     TeleportThing(indy, player);
  1510.     CopyOrient(yl_mk5, indy); # snap him to proper orientation
  1511.  
  1512.     # Disable player...
  1513.     MakeMeStop();
  1514.     DeselectWeaponWait(player); # stow any weapon or lighter
  1515.     CopyPlayerHolsters(player, indy); # make sure our actor has matching props
  1516.     Sleep(0.5); # give him some time to do his stuff
  1517.  
  1518.     # Switch actor indy for player...
  1519.     CopyOrient(indy, player); # orient the player
  1520.     SetThingFlags(player, 0x80000); # hide him
  1521.  
  1522.     ClearThingFlags(indy, 0x80000); # reveal our actor
  1523.     Sleep(0.01);
  1524.  
  1525.     # TO DO: flatten the collision bubble on the bar, so interps can't fail...
  1526.  
  1527.     PlayKey(indy, in_lift, 4, 0x12, 0);
  1528.     sleep(0.3);
  1529.     SetExtCamOffset('-0.2 -0.15 0.15'); # interp cam out to left       
  1530.     Sleep(0.2);
  1531.     PlayVoice(indy, in_groan, 1.0, 0);    
  1532.     Sleep(2.0);
  1533.  
  1534.     If (doorchat == 0)
  1535.     {
  1536.         doorchat = 1; # say line once
  1537.         curSound = PlayVoice(indy, in_doorlocked, 1.0, 0);
  1538.         in_keyTrack1 = PlayKey(indy, in_armsCrossed, 2, 0x10, 0);
  1539.         PlayKey(indy, in_crossArms, 4, 0x12, 1);
  1540.         WaitForSound(cursound);
  1541.         StopKey(indy, in_keyTrack1, 0.5);
  1542.     }
  1543.     else
  1544.     {    
  1545.         PlayVoice(indy, in_notopen, 1.0, 1);
  1546.     }
  1547.         
  1548.     Sleep(0.5);
  1549.  
  1550.     RestoreExtCam();
  1551.     SetThingFlags(indy, 0x80000); # hide actor
  1552.     ClearThingFlags(player, 0x80000); # show player again
  1553.     ClearActorFlags(player, 0x200000); # remove player controls
  1554.     EndCutScene();
  1555.  
  1556.     return;
  1557.  
  1558. # ...................................................................
  1559.  
  1560. callback:
  1561.  
  1562.     sender = GetSenderRef();
  1563.     callNum = GetParam(1);
  1564.  
  1565.     if (sender == indy)
  1566.     {
  1567.         if (in_swapCase == 1)
  1568.         {
  1569.             if (callNum == 21)
  1570.             {
  1571.                 # Swap key in...
  1572.                 in_swapRef = SetThingMesh(indy, 15, mod_in_hand_key, 0);
  1573.             }
  1574.             else if (callNum == 22)
  1575.             {
  1576.                 # No more key..,
  1577.                 RestoreThingMesh(indy, in_swapRef);
  1578.             }
  1579.         }
  1580.         else if (in_swapCase == 2)
  1581.         {
  1582.             if (callNum == 21)
  1583.             {
  1584.                 # Swap plant in...
  1585.                 in_swapRef = SetThingMesh(indy, 15, mod_in_hand_bud, 0);
  1586.             }
  1587.             else if (callNum == 22)
  1588.             {
  1589.                 # No more plant..,
  1590.                 RestoreThingMesh(indy, in_swapRef);
  1591.             }
  1592.         }
  1593.     }
  1594.     else if (sender == oldlady)
  1595.     {
  1596.         if (ol_swapCase == 1)
  1597.         {
  1598.             if (callNum == 21)
  1599.             {
  1600.                 # Swap key...
  1601.                 ol_swapRef = SetThingMesh(oldlady, 22, mod_ol_hand_key, 0);
  1602.             }
  1603.             else if (callNum == 22)
  1604.             {
  1605.                 # No more key..,
  1606.                 RestoreThingMesh(oldlady, ol_swapRef);
  1607.             }
  1608.         }
  1609.         else if (ol_swapCase == 2)
  1610.         {
  1611.             # Swap plant...
  1612.             SetThingMesh(oldlady, 22, mod_ol_hand_bud, 0);
  1613.         }
  1614.     }
  1615.     else if (sender == younglady)
  1616.     {
  1617.         if (yl_swapCase == 1)
  1618.         {
  1619.             # Big flash...
  1620.             sunburst = AttachThingToThingMesh(younglady, sunburst_tpl, 10); 
  1621.             AnimateSpriteSize(sunburst, '0.01 0.01 0.5', '0.8 0.8 0.0', 0.8);
  1622.         }
  1623.         else if (yl_swapCase == 2)
  1624.         {
  1625.             # Remove cane...
  1626.             RestoreThingMesh(younglady, yl_swapRefCane);
  1627.         }
  1628.         else if (yl_swapCase == 3)
  1629.         {
  1630.             # Remove plant...
  1631.             RestoreThingMesh(younglady, yl_swapRefPlant);
  1632.         }
  1633.         else if (yl_swapCase == 4)
  1634.         {
  1635.             # Play bar sound...
  1636.             PlaySoundLocal(sndBarThrow, 1.0, 0, 0x0000, 0);
  1637.         }
  1638.         else if (yl_swapCase == 5)
  1639.         {
  1640.             # Play door sound...
  1641.             PlaySoundLocal(sndDoorOpen, 1.0, 0, 0x0, 0);
  1642.         }
  1643.         yl_swapCase = 0;
  1644.     }
  1645.  
  1646.     return;
  1647.  
  1648. # ...................................................................
  1649.  
  1650. end
  1651.